Skip to content

x86/multikernel: inherit host timer calibration - #5

Merged
congwang-mk merged 1 commit into
multikernel:masterfrom
nickolaev:multikernel-timer-calibration
Aug 13, 2026
Merged

x86/multikernel: inherit host timer calibration#5
congwang-mk merged 1 commit into
multikernel:masterfrom
nickolaev:multikernel-timer-calibration

Conversation

@nickolaev

@nickolaev nickolaev commented Aug 11, 2026

Copy link
Copy Markdown

Summary

Spawned x86 kernels cannot safely repeat timer calibration while the primary kernel owns the legacy PIT, PIC, and I/O APIC resources used by those probes.

This commit appends optional calibration fields to the spawn context and records the primary kernel's delay-loop, CPU, TSC, and local APIC timer measurements when preparing a spawned kernel. The spawned kernel reuses those measurements when explicit command-line overrides are absent.

Existing context offsets remain unchanged. The appended fields are zero-initialized, so unavailable measurements retain the existing fallback behavior, while explicit overrides remain authoritative.

Validation

  • strict checkpatch with no errors, warnings, or checks
  • focused platform-quirks.o and Multikernel spawn object builds
  • full CONFIG_MULTIKERNEL=y kernel build
  • full CONFIG_MULTIKERNEL=n vmlinux build
  • source and model checks for offset preservation, zero-value fallback, explicit overrides, and inherited calibration
  • two sequential QEMU integration passes, each completing all 83 required markers

Spawn kernels cannot calibrate against host-owned PIT, PIC, or IO-APIC
resources. Carry the host loops-per-jiffy, CPU and TSC frequencies, and
local APIC timer calibration in the spawn boot context.

Install fixed calibration callbacks before x86 timer initialization.
Keep explicit command-line calibration authoritative.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
@nickolaev
nickolaev force-pushed the multikernel-timer-calibration branch from 55c05d6 to b24e05c Compare August 11, 2026 23:06
@nickolaev nickolaev changed the title x86/multikernel: validate spawn images and inherit timer calibration x86/multikernel: inherit host timer calibration Aug 11, 2026
@nickolaev
nickolaev marked this pull request as ready for review August 12, 2026 04:50
@congwang-mk
congwang-mk merged commit 211a212 into multikernel:master Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants